@import './variables.scss';

$color-picker-prefix-cls: '#{$x6-prefix}-color-picker';

.#{$color-picker-prefix-cls} {
    position: relative;
    padding: 3px;
    border: 1px solid #e6e6e6;
    border-radius: 4px;
    display: inline-block;
    width: 100%;
    &-block {
		width: 100%;
		height: 18px;
		border-radius: 2px;
	}

	&-panel {
		position: absolute;
		z-index: 2001;
		transform-origin: center top;
		padding: 6px;
		box-sizing: content-box;
		background-color: #FFF;
		border: 1px solid #EBEEF5;
		border-radius: 4px;
		box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
	}

	&-panel-left {
		left: 0;
	}
	&-panel-right {
		right: 0;
	}

    &-canvas {
		position: relative;
	}

	&-canvas canvas {
		left: 0;
		top: 0;
	}

	&-cur {
		width: 3px;
		height: 3px;
		outline: 2px solid #fff;
		margin-left: -1px;
		margin-top: -1px;
		position: absolute;
		border-radius: 50%;
		box-shadow: 0 0 0 1.5px #fff, inset 0 0 1px 1px rgb(0 0 0 / 30%), 0 0 1px 2px rgb(0 0 0 / 40%);
	}
	
	&-bar,&-alpha{
		background-color: #fff;
		position: absolute;
		cursor: pointer;
		border-radius: 1px;
		border: 1px solid #f0f0f0;
		box-shadow: 0 0 2px rgb(0 0 0 / 60%);
	}

	&-bar {
		width: 20px;
		height: 3px;
		left: 0;
		top: 0;
		margin-left: -1px;
		margin-top: -2px;
	}
	
	&-alpha{
		width: 5px;
		height: 20px;
		left: 100%;
		top: 0;
		margin-left: -3px;
		margin-top: -1px;
	}

	&-alpha-silder {
		position: relative;
		box-sizing: border-box;
		width: 256px;
		margin-left: 30px;
		height: 18px;
		background: url();
	}

	&-alpha-silder-bar {
		position: relative;
		background: linear-gradient(to right, rgba(255, 69, 0, 0) 0%, rgb(255, 69, 0) 100%);
		height: 100%;
	}

	&-control {
		display: flex;
		justify-content: space-between;
		align-items: center;
		margin-top: 5px;
	}

	&-input {
		background-color: #FFF;
		background-image: none;
		border-radius: 4px;
		border: 1px solid #DCDFE6;
		box-sizing: border-box;
		color: #606266;
		display: inline-block;
		outline: 0;
		padding: 0 15px;
		transition: border-color .2s cubic-bezier(.645, .045, .355, 1);
		width: 160px;
		font-size: 12px;
		height: 28px;
		line-height: 28px;
	}

	&-input:focus {
		border-color: #409EFF;
	}

	&-btns {
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	&-btn-clear {
		font-size: 12px;
		color: #409EFF;
		cursor: pointer;
	}

	&-btn-confirm {
		padding: 7px 15px;
		margin-left: 10px;
		font-size: 12px;
		border-radius: 3px;
		display: inline-block;
		line-height: 1;
		white-space: nowrap;
		cursor: pointer;
		background: #FFF;
		border: 1px solid #DCDFE6;
		color: #606266;
		text-align: center;
		box-sizing: border-box;
		outline: 0;
		font-weight: 500;
	}
    
    &-predefine {
        display: flex;
        font-size: 12px;
        margin-top: 8px;
        width: 280px;
    }

    &-predefine__colors {
        display: flex;
        flex-wrap: wrap;
        flex: 1 1 0%;
    }

    &-predefine__color-selector:nth-child(10n+1) {
        margin-left: 0px;
    }

    &-predefine__color-selector {
        width: 20px;
        height: 20px;
        cursor: pointer;
        margin: 0px 0px 8px 8px;
        border-radius: 4px;
    }

    &-predefine__color-selector > div {
        display: flex;
        height: 100%;
        border-radius: 3px;
    }
}